



<div id="page_list">
    <h2>Device list</h2>
    <div style="color: red;"><?php echo $this->session->flashdata('message'); ?></div>
    <div><a class="addnew" href="<?php echo base_url();?>index.php/administrator/device/add">+ Add new Device</a></div>
    <table class="list" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th width="5%">Id</th>
                <th width="10%">name</th>
                <th width="8%">dir Image</th>
                <th width="40%">Actions</th>
            </tr>
        </thead>
        <tbody> 
        
        <?php
        if(isset($data) && !empty($data)){
            foreach($data as $key=>$value){
        ?>       
            <tr>
                <td><?php echo $value['device_id'] ;?></td>
                <td><?php echo $value['d_name'];?></td>
                <td><?php echo $value['d_imageDir'];?></td>
                <td>
                    <a href="<?php echo base_url();?>index.php/administrator/device/edit/<?php echo $value['device_id'];?>">Edit</a>
                    <a href="#" onclick="confirmUrl('<?php echo base_url();?>index.php/administrator/device/delete/<?php echo $value['device_id'];?>');" class="confirmDelete">Delete</a>
                </td>
            </tr>
        <?php } } ?>
        </tbody>
    </table>
   <?php   echo $links; ?> 
    
    <br />
    <p class="footer">Total : <?php  echo $total; ?> record 
    </p>
    

<script>
function confirmUrl(url){
    var question=confirm("Do you want delete device?")
    if (question)
    {
        location.href=url;
    }
    else
    {
        return;
    }
}
</script>
